/**
 *
 */
package commons.beancopier;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.tmall.common.beancopier.mapper.PropertiesMapper;


/**
 * @author 陌铭(Phenix Huang)
 *
 */
public class SameBeanPropertyMapperImpl implements PropertiesMapper {

    private Map<String, String> propertyMap = new HashMap<String, String>();

    public SameBeanPropertyMapperImpl(List<String> propertyNames) {
        propertyMap = new HashMap<String, String>();
        for (String name : propertyNames) {
            propertyMap.put(name, name);
        }
        propertyMap = Collections.unmodifiableMap(propertyMap);
    }

    /*
     * @see net.phenix.comp.util.bean.mapper.PropertyMapper#getMappedPropertyNames()
     */
    public Map<String, String> getMappedPropertyNames() {
        return propertyMap;
    }

    /*
     * @see net.phenix.comp.util.bean.mapper.PropertyMapper#getFilterPropertyNames()
     */
    public Collection<String> getFilterPropertyNames() {
        return propertyMap.keySet();
    }

    /*
     * @see net.phenix.comp.util.bean.mapper.PropertyMapper#useExcludeList()
     */
    public boolean useExcludeList() {
        return false;
    }

}
